<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>工资收入明细</title>
    <link rel="stylesheet" type="text/css" href="../../../../css/aui/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../../../css/html/order/get_work_frm.css" />
    <style>
        .list_item {
            padding: 0 0.75rem;
            margin-top: 1rem;
        }

        .iconimg {
            width: 0.6rem;
            display: inline-block;
        }
        [v-clock]{display: none;}
    </style>
</head>

<body>
    <div id="app" v-clock>
        <div class="list_item" v-for="o in list">
            <div class="aui-list">
                <div class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title aui-ellipsis-1">{{o.title}}</div>
                    </div>
                </div>
                <div class="aui-list-item">
                    <div class="aui-media-list-item-inner">
                        <div class="aui-list-item-media">
                            <img :src="o.headimgurl">
                        </div>
                        <div class="person_info">
                            <div> <img src="../../../../image/icon/menu02-1.png" class="iconimg" alt=""> <span>联系人：{{o.contact}}</span></div>
                            <div> <img src="../../../../image/icon/daohang.png" class="iconimg" alt=""> <span>项目地点：{{o.region}}</span></div>
                            <div> <img src="../../../../image/icon/time.png" class="iconimg" alt=""> <span>发布时间：{{o.work_date}}</span></div>
                        </div>
                    </div>
                </div>
                <div class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">所需工期</div>
                        <div class="aui-list-item-right" style="color:#212121;">{{o.work_time}}天</div>
                    </div>
                </div>
                <div class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">所需费用</div>
                        <div class="aui-list-item-right" style="color:#212121;">{{o.order_price}}元</div>
                    </div>
                </div>
                <div class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">平台服务费</div>
                        <div class="aui-list-item-right" style="color:#212121;">{{o.service_fee}}元</div>
                    </div>
                </div>
                <div class="aui-list-item" v-if="o.refund_price != 0">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">退款差价</div>
                        <div class="aui-list-item-right" style="color:#212121;">{{o.refund_price}}元</div>
                    </div>
                </div>
                <div class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">总计提成</div>
                        <div class="aui-list-item-right" style="color:#212121;">{{o.ticheng}}元</div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</body>
<script src="../../../../script/api.js" charset="utf-8"></script>
<script src="../../../../script/aui/aui-tab.js" charset="utf-8"></script>
<script src="../../../../script/common/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="../../../../script/common/common.js" charset="utf-8"></script>
<script src="../../../../script/common/config.js" charset="utf-8"></script>
<script src="../../../../script/common/vue.min.js" charset="utf-8"></script>
<script>
    apiready = function() {
        api.parseTapmode();
        vm.init();
    }

    var vm = new Vue({
        el: "#app",
        data: {
            userInfo: {},

            list: [],
            listType: 1,
            listPage: 1,
            listStatus: true,
        },
        methods: {
            init() {
                this.userInfo = get_local("userInfo");
                this.upDownLoad();
                this.getList();
            },
            getList() {
                var that = this;
                var data = {
                    user_id: this.userInfo.user_id,
                    pages: this.listPage
                };
                _ajax(Config.api.UserWalletGetCompleteWorkLists, data, function(ret) {
                    if (ret.code === 200) {
                        if (ret.data.length > 0) {
                            that.list = that.list.concat(ret.data);
                            console.log(JSON.stringify(that.list));
                        } else {
                            that.listStatus = false;
                        }
                    }
                });
            },
            upDownLoad() {
                var that = this;

                // 下拉刷新
                push_down(function() {
                    //下拉刷新恢复
                    push_down_over();
                    that.listStatus = true;
                    that.listPage = 1;
                    that.list = [];
                    that.getList();
                });

                //上拉加载
                push_up(function() {
                    if (that.listStatus) {
                        that.listPage++;
                        that.getList();
                    }
                });
            },
            openWin(name) {
                var winInfo = {
                    chakan_ticheng: {
                        name: 'chakan_ticheng_win',
                        url: './chakan_ticheng_win.html'
                    },
                };
                if (name) {
                    open_w(winInfo[name].name, winInfo[name].url);
                } else {
                    $toast("正在开发中...");
                }
            }
        }
    });
</script>

</html>
